﻿// Written by Tim Grant and Adam Bradford for CS3500, Nov. 2012

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CustomNetworking;
using ListExtensions;

namespace Boggle
{
    /// <summary>
    /// A ClientConnection represents a single player in a BoggleGame.
    /// 
    /// When one ClientConnection has been paired with another in a game,
    /// each player is the other's sole opponent:
    /// 
    ///     Player1.opponent == Player2 && Player2.opponent == Player1
    /// 
    /// Once the game has ended, each ClientConnection is closed.
    /// </summary>
    public class ClientConnection
    {
        // properties
        public string Name { get; private set; }
        public StringSocket SS { get; private set; }
        public List<string> LegalWords { get; private set; }
        public List<string> IlegalWords { get; private set; }

        // member variables
        public int score;
        public ClientConnection opponent;

        /// <summary>
        /// Creates a new ClientConnection.
        /// </summary>
        /// <param name="name">The name of the player.</param>
        /// <param name="socket">Socket for communicating with the server</param>
        public ClientConnection(string name, StringSocket socket)
        {
            Name = name;
            SS = socket;
            LegalWords = new List<string>();
            IlegalWords = new List<string>();
            score = 0;
        }
    }
}
